﻿<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="Veterans._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to Military Life</h2>
    <p>
        Be a member of our sociaty&nbsp; ... Join us TODAY</p>
    <p>
        Please Choose Your Subject From the Menu in the top ( Family - Friends - General 
        ) </p>
    <p>
        lastest Five Subjects :</p>
    <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" 
        AutoGenerateColumns="False" Width="100%" AllowSorting="True" 
        CellPadding="4" ForeColor="#333333">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="T_type" HeaderText="Category" />
            <asp:HyperLinkField DataNavigateUrlFields="T_ID" 
                DataNavigateUrlFormatString="Details.aspx?D={0}" DataTextField="T_Title" 
                HeaderText="Subject" SortExpression="T_ID" >
            <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
            </asp:HyperLinkField>
            <asp:BoundField DataField="T_time" HeaderText="added Time" SortExpression="T_time" >
            <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="T_Writer" HeaderText="Added by" 
                SortExpression="T_Writer" >
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <EmptyDataTemplate>
            Sorry No Data Found !!!
        </EmptyDataTemplate>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT TOP 5 [T_ID], [T_Title], [T_Picture], [T_Text], [T_time], [T_Writer], [T_type] FROM [TBL_Topics] order by [T_time] desc">
    </asp:SqlDataSource>
    <p>
        Top 5 Subjects by rating&nbsp; :</p>
    <asp:GridView ID="GridView2" runat="server" DataSourceID="SqlDataSource2" 
        AutoGenerateColumns="False" Width="100%" AllowSorting="True" 
        CellPadding="4" ForeColor="#333333">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="T_type" HeaderText="Category" />
            <asp:HyperLinkField DataNavigateUrlFields="T_ID" 
                DataNavigateUrlFormatString="Details.aspx?D={0}" DataTextField="T_Title" 
                HeaderText="Subject" SortExpression="T_ID" >
            <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
            </asp:HyperLinkField>
            <asp:BoundField DataField="T_time" HeaderText="added Time" SortExpression="T_time" >
            <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="T_Writer" HeaderText="Added by" 
                SortExpression="T_Writer" >
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <EmptyDataTemplate>
            Sorry No Data Found !!!
        </EmptyDataTemplate>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        
        SelectCommand="SELECT [T_ID], [T_Title], [T_Picture], [T_Text], [T_time], [T_Writer], [T_type] FROM [TBL_Topics] where [T_ID] in ( SELECT b.[T_fkID] from [Average_Rating_Query] b order by b.[AvgOfRate] ) ">
    </asp:SqlDataSource>
    <p> Active Member : <asp:Label ID="Lbl_ActiveMember" runat="server" Text=""></asp:Label>&nbsp; with &nbsp;<asp:Label ID="Lbl_Count" runat="server" Text=""></asp:Label> Participation(s) </p>
    <p> Newest Member : <asp:Label ID="Lbl_NewestMember" runat="server" Text=""></asp:Label></p>
    <p> &nbsp;</p>
    <p> &nbsp;</p>
    
</asp:Content>
